/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ares.service.util;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

/**
 *
 * @author electro
 */
public class Redondear {
    private static Locale currentLocale = new Locale ("en","US") ;
    public static String formatearANingunDecimalSimple(String cadena){
        double d = Double.parseDouble(cadena);
            NumberFormat numberFormatter = NumberFormat.getNumberInstance(currentLocale);
            DecimalFormat df = (DecimalFormat)numberFormatter;
            df.applyPattern("######");
            return df.format(d);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String cadena = "4.35";
        double numero = 5.89;
        System.out.println("El numero redondeado es: " + formatearANingunDecimalSimple(cadena));

        // TODO code application logic here
    }

}
